#include "SymbolTableEntry.h"
#include <string.h>
#include <malloc.h>

SymbolTableEntry::SymbolTableEntry(const Token *i_Token)
{
	this->m_Name = ::strdup(i_Token->lexeme);
	this->m_Type = none_Type;
	this->m_Kind = none_Kind;
	this->m_Token = i_Token;
}

SymbolTableEntry::~SymbolTableEntry(void)
{
	::free(this->m_Name);
}
	
const char *SymbolTableEntry::GetName(void) const
{
	return this->m_Name;
}

void SymbolTableEntry::SetType(eType i_Type)
{
	this->m_Type = i_Type;
}

eType SymbolTableEntry::GetType(void) const
{
	return this->m_Type;
}

void SymbolTableEntry::SetKind(eKind i_Kind)
{
	this->m_Kind = i_Kind;
}

eKind SymbolTableEntry::GetKind(void) const
{
	return this->m_Kind;
}

const Token *SymbolTableEntry::GetToken(void) const
{
	return this->m_Token;
}

bool SymbolTableEntry::IsConstant(void) const
{
	return this->m_Kind == constant_Kind;
}
